package com.tiyo.common.core.page;

import java.io.Serializable;

import javax.validation.constraints.NotNull;

import com.tiyo.common.utils.StringUtils;


@SuppressWarnings("serial")
public class PageDomain implements Serializable{
	@NotNull(message="分页参数不能为空")
	private Integer current;
	@NotNull(message="分页参数不能为空")
	private Integer size;
	private String searchValue;
	private String orderByColumn;
	private String isAsc;
	public Integer getCurrent() {
		return current;
	}
	public void setCurrent(Integer current) {
		this.current = current;
	}
	public Integer getSize() {
		return size;
	}
	public void setSize(Integer size) {
		this.size = size;
	}
	public String getSearchValue() {
		return searchValue;
	}
	public void setSearchValue(String searchValue) {
		this.searchValue = searchValue;
	}
	public String getOrderByColumn() {
		return orderByColumn;
	}
	public String getOrderByXiaHuaXianColumn() {
		if(StringUtils.isNotEmpty(orderByColumn)) {
			return StringUtils.tuoFengToxiaHuaXian(orderByColumn);
		}
		return orderByColumn;
	}
	public void setOrderByColumn(String orderByColumn) {
		this.orderByColumn = orderByColumn;
	}
	public String getIsAsc() {
		return isAsc;
	}
	public void setIsAsc(String isAsc) {
		this.isAsc = isAsc;
	}
	public boolean isAsc() {
		return "asc".equals(isAsc);
	}
	public boolean isCondition() {
		return StringUtils.isNotEmpty(isAsc)&&StringUtils.isNotEmpty(orderByColumn);
	}
}
